Publish arsenal to GitHub Packages and npm on release#2657
Open
delthas wants to merge 2 commits into
Open
Conversation
Contributor
Hello delthas,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Contributor
Request integration branchesWaiting for integration branch creation to be requested by the user. To request integration branches, please comment on this pull request with the following command: Alternatively, the |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development/8.4 #2657 +/- ##
===================================================
- Coverage 74.03% 74.00% -0.03%
===================================================
Files 229 229
Lines 18503 18503
Branches 3845 3820 -25
===================================================
- Hits 13699 13694 -5
- Misses 4799 4804 +5
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
c06db2c to
2b07c4a
Compare
2b07c4a to
ba6a25d
Compare
ba6a25d to
7d72e9c
Compare
3946f2a to
24ffbc9
Compare
6a85917 to
45f5079
Compare
45f5079 to
dece6b0
Compare
Extend the manual release workflow (ARSN-604) to build and dual-publish @scality/arsenal (a public, Apache-2.0 library) to GitHub Packages and npmjs, split into jobs so the build is produced once and each publish can be retried independently of it and of the other: - build: after the branch/version/tag guards, install, build, pack the tarball, generate a signed build-provenance attestation for it (actions/attest-build-provenance), and upload it as the artifact. - publish-github: download the tarball and publish it to GitHub Packages with the built-in GITHUB_TOKEN. - publish-npm: publish the same tarball to npmjs via OIDC trusted publishing (id-token, no stored token) with --provenance. - release: create the GitHub release, linking to both packages. Both publish jobs use the committed package.json version (no auto-bump), check the registry with npm view first and skip if that version is already published (so a partial dual-publish can be re-run cleanly), and publish under a v<major.minor> dist-tag so an older release line never moves the latest tag. Building and packing once, then attesting and publishing the same tarball to both registries, yields a single GitHub attestation covering whatever lands in either registry, plus npm-native provenance on npmjs. package.json is renamed to @scality/arsenal, drops the private flag, and gains types, files and publishConfig.access: public. The scoped name is committed directly rather than stamped at publish time: git-dependency consumers resolve arsenal by their dependency key, not the package name, so committing @scality/arsenal keeps require('arsenal') working for the current git consumers (verified) while making the published package correctly scoped. Token permissions are scoped per job. The workflow tests stub the publish path so the guard coverage is unchanged. Issue: ARSN-605
dece6b0 to
54cde5f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Builds on the manual release workflow from ARSN-604 (#2656): on release, build and dual-publish
@scality/arsenalto GitHub Packages and npmjs. arsenal is a public, Apache-2.0 library, so per the DevEx TAD it goes to both registries. Non-breaking — existing git-dependency consumers (cloudserver, backbeat, vault2) are untouched; migrating them to the registry is a later, organic step.release.yamlis split into jobs so the build is produced once and each publish can be retried independently of it and of the other:yarn build,npm pack, generate a signed build-provenance attestation for the tarball (actions/attest-build-provenance), and upload the.tgzas the artifact.GITHUB_TOKEN.id-token: write, no stored token) with--provenance.Both publish jobs use the committed
package.jsonversion (no auto-bump), check the registry withnpm viewfirst and skip if that version is already published — so a partial dual-publish can be re-run cleanly — and publish under av<major.minor>dist-tag so an older release line never moveslatest. Building and packing once, then attesting and publishing the same tarball to both registries, gives a single GitHub attestation (gh attestation verify <tarball> --repo scality/Arsenal) covering whatever lands in either registry, plus npm-native provenance on npmjs.Name: committed, not stamped
package.jsonis renamed to@scality/arsenaldirectly — no publish-time name stamp /jq. Git-dependency consumers resolve arsenal by their dependency key, not the package'sname, so committing the scoped name keepsrequire('arsenal')working for cloudserver/backbeat/vault2 (verified end-to-end: real arsenal committed as@scality/arsenal, consumed under the unchanged barearsenalgit key, installs tonode_modules/arsenaland resolves both bare and deeparsenal/build/...imports).package.jsonalso dropsprivateand addstypes/files+publishConfig.access: public. The version stays committed / manually bumped — auto-stamping is deferred to a later step.The workflow tests under
tests/workflowsstub the publish path, so the guard coverage is unchanged.Prerequisite (npmjs trusted publishing)
The npm publish uses OIDC trusted publishing — no
NPM_TOKEN. Before the first npm release, a trusted publisher must be registered for@scality/arsenal: GitHub orgscality, repoArsenal, workflowrelease.yaml(the same setup Sylvain did for@scality/cloudserverclient). Since@scality/arsenalisn't on npm yet, bootstrap it one of two ways:@scalitypublish rights (yarn build && npm publish --access public) to create the package, then register the trusted publisher. That first version has no provenance (local publish); the workflow provenance-signs every release after it and skips the bootstrapped version via itsnpm viewcheck.@scalitynpm org allows creating packages via OIDC — then the first workflow run creates it, no manual step.GitHub Packages needs no bootstrap (built-in
GITHUB_TOKEN).Aligned with the DevEx initiative (S3C-9725); mirrors the dual-publish model of
hdclient/cloudserverclient.Issue: ARSN-605